package astudy.networking.ftp;

import org.apache.commons.lang.StringUtils;

public class Request {

	private String command;
	private String[] args;
	
	public String getCommand() {
		return command;
	}

	public void setCommand(String command) {
		this.command = command;
	}

	public String[] getArgs() {
		return args;
	}

	public void setArgs(String[] args) {
		this.args = args;
	}

	public Request(String command) {

		this.command = command;
		this.args = new String[] {};
	}

	public Request(String command, String arg) {

		this.command = command;
		this.args = new String[] {arg};
	}

	public Request(String command, String[] args) {

		this.command = command;
		this.args = args;
	}
	
	@Override
	public String toString() {
		
		String str = "";
		str += command + " ";
		str += StringUtils.join(args, ",");
		str += "\r\n";
		return str;
	}
}
